package com.acquisition.task.constants;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

/**
 * 其他常数
 *
 * @author wuqiwei
 * @date 2020/10/15
 */
public class Constants {

	/**
	 * 当前APP名称
	 */
	public static final String APP_NAME = "DataCollectionSystem";

	/**
	 * 当前APP版本号
	 */
	public static final String APP_VERSION = "1.0";

	/**
	 * netty服务器socket端口
	 */
	public static final int NETTY_SOCKET_PORT = 8000;

	/**
	 * 报文结尾分割符号\r\n
	 */
	public static final String DELIMITER_SYMBOL = "\r\n";

	/**
	 * 报文结尾分割符号\r\n，ByteBuf
	 */
	public static ByteBuf DELIMITER_SYMBOL_BYTES = Unpooled.copiedBuffer(DELIMITER_SYMBOL.getBytes());

	/**
	 * FTP主机服务器地址
	 */
	public static final String FTP_IP = "60.2.213.22";

	/**
	 * FTP主机服务器端口
	 */
	public static final int FTP_PORT = 11621;

	/**
	 * FTP主机服务器用户名
	 */
	public static final String FTP_USER = "apk";

	/**
	 * FTP主机服务器密码
	 */
	public static final String FTP_PASSWORD = "1329851034";

	/**
	 * 上传到FTP的日志路径
	 */
	public static final String FTP_PATH_LOG = "/log/DataCollectionSystem";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_ANDROID_ID = "android_id";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_MN = "mn";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_CAMERA = "CameraParam";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_HJ212 = "Hj212Param";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_MODBUSSLAVE = "ModbusSlaveParam";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_MONITOR = "MonitorFactorParam";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_NETWORK = "NetworkParam";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_SERIALPORTNAME = "SerialPortNameParam";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_SERIALPORT = "SerialPortParam";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_UNIT = "UnitParam";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_UPLOAD = "UploadParam";

	/**
	 * param的key
	 */
	public static final String PARAM_KEY_WARNING = "WarningParam";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_CAMERA = "CameraConfig";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_CENTER = "CenterServerConfig";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_HJ212 = "HJ212Config";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_RTU = "ModbusRtuConfig";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_SLAVE = "ModbusSlaveConfig";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_NET = "NetConfig";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_UNIT = "ParamUnitConfig";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_SERIAL = "SerialPortConfig";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_SERIAL_NAME = "SerialPortNameConfig";

	/**
	 * dto_type
	 */
	public static final String DTO_TYPE_WARN = "WarningConfig";

	/**
	 * 上传状态：未上传，需要上传
	 */
	public static final int UPLOAD_FLAG_0 = 0;

	/**
	 * 上传状态：已上传，无需上传
	 */
	public static final int UPLOAD_FLAG_1 = 1;

	/**
	 * 服务器返回新MN号的关键字
	 */
	public static final String RESULT_MSG_MN_NEW = "OKOK,new,";

	/**
	 * 服务器返回心跳报文的关键字
	 */
	public static final String RESULT_MSG_HEART_SUCCESS = "OKOK,";

	/**
	 * 服务器返回重启设备的关键字
	 */
	public static final String RESULT_MSG_PARAM_RESTART = "\"type\":\"restart\"";

	/**
	 * 服务器返回上传日志的关键字
	 */
	public static final String RESULT_MSG_PARAM_LOG = "\"type\":\"log\"";

	/**
	 * 服务器返回设备参数的关键字
	 */
	public static final String RESULT_MSG_DEVICE_PARAM = "{\"param\":";

	/**
	 * 服务器返回所有设备参数的关键字
	 */
	public static final String RESULT_MSG_ALL_PARAM = "{\"InitParam\":";

	/**
	 * 服务器返回上传设备参数成功的关键字
	 */
	public static final String RESULT_MSG_PARAM_SUCCESS = "success:DeviceParam";

	/**
	 * 服务器返回实时数据上传成功的关键字
	 */
	public static final String RESULT_MSG_UPLOAD_SUCCESS_REALTIME = "success:RealTimeData";

	/**
	 * 服务器返回分钟数据上传成功的关键字
	 */
	public static final String RESULT_MSG_UPLOAD_SUCCESS_MINUTE = "success:MinuteData";

	/**
	 * 服务器返回小时数据上传成功的关键字
	 */
	public static final String RESULT_MSG_UPLOAD_SUCCESS_HOUR = "success:HourData";

	/**
	 * 服务器返回日数据上传成功的关键字
	 */
	public static final String RESULT_MSG_UPLOAD_SUCCESS_DAY = "success:DayData";

	/**
	 * 设备参数发送给服务器时的关键字
	 */
	public static final String SEND_MSG_PARAM = "DeviceParam";

	/**
	 * API接口获取实时数据
	 */
	public static final String API_MSG_TYPE_FRONTEND = "frontend";

	/**
	 * API接口获取实时数据
	 */
	public static final String API_MSG_GET_REALTIME = "getRealTimeData";

	/**
	 * API接口获取分钟数据
	 */
	public static final String API_MSG_GET_MINUTE = "getMinuteData";

	/**
	 * API接口获取小时数据
	 */
	public static final String API_MSG_GET_HOUR = "getHourData";

	/**
	 * API接口获取日数据
	 */
	public static final String API_MSG_GET_DAY = "getDayData";

	/**
	 * API接口获取设备参数
	 */
	public static final String API_MSG_GET_PARAM = "getParam";

	/**
	 * API接口设置设备参数
	 */
	public static final String API_MSG_SET_PARAM = "setParam";

	/**
	 * API接口获取系统时间
	 */
	public static final String API_MSG_GET_TIME = "getSystemTime";

	/**
	 * API接口获取内部服务器地址
	 */
	public static final String API_MSG_GET_SERVER = "getServer";

	/**
	 * API接口检查APP是否卡死
	 */
	public static final String API_MSG_CHECK_APP = "checkApp";

	/**
	 * 返回结果的类型，成功：1
	 */
	public static final int RESULT_CODE_SUCCESS = 1;

	/**
	 * 返回结果的类型，错误：500
	 */
	public static final int RESULT_CODE_ERROR = 500;

	/**
	 * 协议类型无协议类型
	 */
	public static final int PROTOCOL_TYPE_NONE = 0;

	/**
	 * 协议类型HJ212-2017版协议
	 */
	public static final int PROTOCOL_TYPE_2017 = 1;

	/**
	 * 协议类型HJ212-2005版协议
	 */
	public static final int PROTOCOL_TYPE_2005 = 2;

	/**
	 * 协议类型河北省版协议
	 */
	public static final int PROTOCOL_TYPE_HEBEI = 3;

	/**
	 * 协议类型modbusRtu版协议
	 */
	public static final int PROTOCOL_TYPE_MODBUS = 4;

	/**
	 * 第一个服务器
	 */
	public static final int SEVER_NUM_1 = 1;

	/**
	 * 第二个服务器
	 */
	public static final int SEVER_NUM_2 = 2;

	/**
	 * 第三个服务器
	 */
	public static final int SEVER_NUM_3 = 3;

	/**
	 * 第四个服务器
	 */
	public static final int SEVER_NUM_4 = 4;

	/**
	 * 一个特殊的串口，该串口含有多条监测因子的数据
	 */
	public static final String DEV_TTYS2 = "/dev/ttyS2";

}
